<include file="Public:header" />

<load href ="__PUBLIC__/Js/common.js" />
<div id="main" class="main" >
<script language="JavaScript">
<!--


	function getProductPrice(){
		var pid = $('productId')[$('productId').selectedIndex].value;
	    var productName = $('productId')[$('productId').selectedIndex].text;
	    $('productName').value = productName;
	    ThinkAjax.send('__APP__/Product/getPrice/','pid='+pid,insertPrice,'','');
	}

	function insertPrice(json){
		$('price').value=json.price;
	}

	function checkInfo(){
		if($('productId')[$('productId').selectedIndex].value == $('lastProductId').value){
			alert('无修改');
			return false;
		}
		var diff = $('money').innerHTML-$('price').value;
		if(diff>0){
			return confirm('此修改将会给会员充值：'+ diff  +'元');
		}else if(diff<0){
			diff = Math.abs(diff);
			return confirm('此修改将会扣除会员：'+ diff +'元');
		}else{
			return true;
		}

	}
//-->
</script>
<div class="content">
<div class="title">支付记录修改 [ <a href="__URL__">返回列表</a> ]</div>
<table cellpadding=3 cellspacing=3>

<tr>
	<td class="tRight" colspan="4"><hr></td>
</tr>

<form method='get' action="#"; onsubmit="return checkInfo();">
<input type="hidden" name="productName" id="productName"/>
<input type="hidden" name="cardId" id="cardId" value="{$payLog.cardId}"/>
<input type="hidden" name="lastProductId" id="lastProductId" value="{$productLog.productId}"/>
<tr>
	<td class="tRight">会员名：</td>
	<td class="tLeft" >
		{$member}
	</td>
</tr>
<tr>
	<td class="tRight">购买产品:</td>
	<td class="tLeft" >
	<select name="productId" id="productId" onchange="getProductPrice();">
		<volist name="productList" id="pl">
		<if condition="$pl[id]==$productLog[productId]">
			<option value="{$pl.id}" selected="selected">{$pl.name}</option>
		<else />
			<option value="{$pl.id}">{$pl.name}</option>
		</if>
		</volist>
	</select><input id="price" name="price" readonly="readonly" size="8"/>

	</td>
</tr>

<tr>
	<td class="tRight">支付金额:</td>
	<td class="tLeft" id="money" >
		{$payLog.money}
	</td>
</tr>

<tr>
	<td></td>
	<td class="center"><input type="hidden" name="id" value="{$vo.id}" >
	<input type="submit" value="修改" class="small submit">
	<input type="reset" class="submit  small" value="清 空" >
	</td>
</tr>
<tr>
	<td class="tRight tTop">操作人：</td>
	<td class="tLeft" >{$Think.session.loginUserName}</td>
</tr>
</table>
</form>
</div>
</div>
